The Long Valley Fire Company confirmed the generator blaze as they responded to West Morris Central High School just after 4:20 a.m.
The building had lost power earlier in the evening, and the morning staff saw the fire as they arrived, LVFC said.
The gas supply was isolated before crews arrived and extinguished the fire “without issue,” they said.
Meanwhile, the generator was severely damaged.
The scene was cleared around 5:15 a.m., LVFC said.
Scroll down to view additional photos from the scene.
Click here to follow Daily Voice Elizabeth and receive free news updates.